package cn.paul.wechatshop.service;

import cn.paul.wechatshop.common.ServerResponse;
import cn.paul.wechatshop.dto.OrderDTO;
import cn.paul.wechatshop.form.OrderForm;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 徐凌峰
 * @date 2017/12/12 0012
 */

public interface IOrderMasterService {
    /**
     * 创建订单
     */
    String create(OrderForm orderForm);

    /**
     * 查询订单
     */

    ServerResponse<OrderDTO> findOne(String orderId);

    /**
     * 查询订单列表
     */
    ServerResponse findList(String buyerOpenid, Pageable pageable);

    /**
     * 取消订单
     */

    /**
     * 完结订单
     */

    ServerResponse<OrderDTO> finish(String orderId);


    @Transactional
    ServerResponse<OrderDTO> cancel(String orderId);

    /**
     * 支付订单
     */
    @Transactional
    ServerResponse<OrderDTO> pay(String orderId);
}
